CC = @CC@
LDFLAGS  = @LDFLAGS@ -lBTstack -L../src
CPPFLAGS = @CPPFLAGS@ -I../include
prefix = @prefix@

all: test mitm rfcomm inquiry l2cap-server l2cap-throughput

test: test.c
	$(CC) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
	@USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@

l2cap-server: l2cap-server.c
	$(CC) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
	@USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@

l2cap-throughput: l2cap-throughput.c
	$(CC) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
	@USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@

mitm: mitm.c
	$(CC) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
	@USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@

inquiry: inquiry.c
	$(CC) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
	@USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@

rfcomm: rfcomm.c
	$(CC) $(CPPFLAGS) -o $@ $< $(LDFLAGS)
	@USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@

clean:
	rm -f test mitm rfcomm inquiry l2cap-server l2cap-throughput obex
	
install:    
	echo "nothing to be done"

